﻿class Program
{
    static void Main()
    {
        List<Order> orderList = [
            new Order { OrderID = "001", CustomerName = "张三", Price = 1200 },
            new Order { OrderID = "002", CustomerName = "李四", Price = 800 },
            new Order { OrderID = "003", CustomerName = "张三", Price = 500 },
            new Order { OrderID = "004", CustomerName = "王五", Price = 1500 },
            new Order { OrderID = "005", CustomerName = "李四", Price = 700 },
            new Order { OrderID = "006", CustomerName = "赵六", Price = 300 }
        ];

        var orders = orderList.GroupBy(o => o.CustomerName).Select(g => new
        {
            CustomerName = g.Key,
            TotalPrice = g.Sum(o => o.Price)
        });
        
        foreach (var order in orders)
        {
            Console.WriteLine($"客户姓名: {order.CustomerName}, 订单总金额: {order.TotalPrice}");
        }
    }
}